
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Tama_Chan.GameEngine_ns;


namespace Tama_Chan.Entities_ns
{
   public abstract class  GameEntity
   {
      public String Name { get; set; }
      public GameEngine GameEngine { get; set; }
      public Texture2D Texture { get; set; }
      public Color Color { get; set; }
      public long IntervalOne { get; set; }
      public long IntervalTwo { get; set; }
      public long IntervalThree { get; set; }
      public long AccumulatedTicksOne { get; set; }
      public long AccumulatedTicksTwo { get; set; }
      public long AccumulatedTicksThree { get; set; }
      public long LifeTime { get; set; }
      public Random Random { get; set; }
      public float TurnSpeed { get; set; }
      public float Depth { get; set; }
      public Vector2 Origin { get; set; }
      public SoundEffectInstance SoundOne { get; set; }
      public SoundEffectInstance SoundTwo { get; set; }
      public Rectangle Bounds { get; set; }
      public Vector2 Position { get; set; }
      public Vector2 Velocity { get; set; }
      public Vector2 Scale { get; set; }
      public int ScoreValue { get; set; }
      public int HealthValue { get; set; }
      public TeleporterState TeleporterCurrentState {get; set;}
      public Teleporter TargetTeleporter { get; set; }
      public float Speed { get; set; }
      public GameEntity Target { get; set; }
      public Vector2 Heading { get; set; }
      public SeekPoint Nose { get; set; }
      public SeekPoint PerpendicularClockwise { get; set; }
      public SeekPoint PerpendicularCounterClockwise { get; set; }
      public float Rotation { get; set; }
      public float RotationRate { get; set; }
      public bool IsDead { get; set; }
      public Color[] ColorArray { get; set; }
      public int ColorArrayCurrentIndex { get; set; }
      public Vector2[] ScaleArray { get; set; }
      public int ScaleArrayCurrentIndex { get; set; }


      protected GameEntity()
      {
         Random = new Random(base.GetHashCode());

         if(Scale == Vector2.Zero)
         {
            Scale = Vector2.One;
         }
      }


      public virtual void Update(GameTime gameTime)
      {
         Bounds = new Rectangle(
            (int)(Position.X - Origin.X * Scale.X),
            (int)(Position.Y - Origin.Y * Scale.Y),
            (int)(Texture.Width * Scale.X),
            (int)(Texture.Height * Scale.Y));
      }


      public virtual void Draw()
      {
         // No default behavior
      }

   }
}
